<?php
/**
 * User: 五哥派
 * Date: 2024/6/29
 * Tel(同WX): 17335592719
 */
namespace app\admin\model\store;

use app\admin\model\Base;

class Order extends Base{

    protected $name = 'store_order';

    public function user(){
        return $this->belongsTo('app\admin\model\user\User','user_id');
    }

    public function orderitem(){
        return $this->hasMany('order_item','order_id', 'id');
    }

    public function getList($where=array(), $limit = 10, $page = 1){
        return self::with(['user', 'orderitem'])->where($where)->order($this->order)->paginate($this->limit, false);
    }
}